Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/analytics/AnalyticsPrefsImpl.kt bd2863243bab6eb213401d949839a2bc74dde7e2 (bd286324) Text, 2.82 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.prefs.analytics

Tff7b72import T7ee787androidx.datastore.preferences.core.booleanPreferencesKey
Tff7b72import T7ee787androidx.datastore.preferences.core.edit
Tff7b72import T7ee787androidx.datastore.preferences.core.stringPreferencesKey
Tff7b72import T7ee787kotlinx.coroutines.CoroutineScope
Tff7b72import T7ee787kotlinx.coroutines.SupervisorJob
Tff7b72import T7ee787kotlinx.coroutines.flow.SharingStarted
Tff7b72import T7ee787kotlinx.coroutines.flow.StateFlow
Tff7b72import T7ee787kotlinx.coroutines.flow.map
Tff7b72import T7ee787kotlinx.coroutines.flow.stateIn
Tff7b72import T7ee787kotlinx.coroutines.launch
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.di.CoroutineDispatchers
Tff7b72import T7ee787org.meshtastic.core.prefs.di.AnalyticsDataStore
Tff7b72import T7ee787org.meshtastic.core.prefs.di.AppDataStore
Tff7b72import T7ee787org.meshtastic.core.repository.AnalyticsPrefs
Tff7b72import T7ee787kotlin.uuid.Uuid

Tf0883e@Single
Tff7b72class T56d364AnalyticsPrefsImplTb4b4b4(
Tff7b72private Tff7b72val Te6edf3analyticsDataStoreTb4b4b4: Te6edf3AnalyticsDataStoreTb4b4b4,
Tff7b72private Tff7b72val Te6edf3appDataStoreTb4b4b4: Te6edf3AppDataStoreTb4b4b4,
Te6edf3dispatchersTb4b4b4: Te6edf3CoroutineDispatchersTb4b4b4,
Tb4b4b4) Tb4b4b4: Te6edf3AnalyticsPrefs Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3scope Tff7b72= Te6edf3CoroutineScopeTb4b4b4(Te6edf3SupervisorJobTb4b4b4(Tb4b4b4) Tff7b72+ Te6edf3dispatchersTb4b4b4.Te6edf3defaultTb4b4b4)

Tff7b72override Tff7b72val Te6edf3analyticsAllowedTb4b4b4: Te6edf3StateFlowTff7b72<Tffa657BooleanTff7b72> Tff7b72=
Te6edf3analyticsDataStoreTb4b4b4.Te6edf3data
Tb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTff7b72[Te6edf3KEY_ANALYTICS_ALLOWED_PREFTff7b72] Tff7b72?: Tff7b72true Tb4b4b4}
Tb4b4b4.Te6edf3stateInTb4b4b4(Te6edf3scopeTb4b4b4, Te6edf3SharingStartedTb4b4b4.Te6edf3EagerlyTb4b4b4, Tff7b72trueTb4b4b4)

Tff7b72override Tff7b72fun Td2a8ffsetAnalyticsAllowedTb4b4b4(Te6edf3allowedTb4b4b4: Tffa657BooleanTb4b4b4) Tb4b4b4{
Te6edf3scopeTb4b4b4.Te6edf3launch Tb4b4b4{ Te6edf3analyticsDataStoreTb4b4b4.Te6edf3edit Tb4b4b4{ Te6edf3prefs Tff7b72-Tff7b72> Te6edf3prefsTff7b72[Te6edf3KEY_ANALYTICS_ALLOWED_PREFTff7b72] Tff7b72= Te6edf3allowed Tb4b4b4} Tb4b4b4}
Tb4b4b4}

Tff7b72override Tff7b72val Te6edf3installIdTb4b4b4: Te6edf3StateFlowTff7b72<Tffa657StringTff7b72> Tff7b72=
Te6edf3appDataStoreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTff7b72[Te6edf3KEY_INSTALL_ID_PREFTff7b72] Tff7b72?: Ta5d6ff"Ta5d6ff" Tb4b4b4}Tb4b4b4.Te6edf3stateInTb4b4b4(Te6edf3scopeTb4b4b4, Te6edf3SharingStartedTb4b4b4.Te6edf3EagerlyTb4b4b4, Ta5d6ff"Ta5d6ff"Tb4b4b4)

Tff7b72init Tb4b4b4{
Te6edf3scopeTb4b4b4.Te6edf3launch Tb4b4b4{
Te6edf3appDataStoreTb4b4b4.Te6edf3edit Tb4b4b4{ Te6edf3prefs Tff7b72-Tff7b72>
Tff7b72if Tb4b4b4(Te6edf3prefsTff7b72[Te6edf3KEY_INSTALL_ID_PREFTff7b72] Tff7b72=Tff7b72= Tff7b72nullTb4b4b4) Tb4b4b4{
Te6edf3prefsTff7b72[Te6edf3KEY_INSTALL_ID_PREFTff7b72] Tff7b72= Te6edf3UuidTb4b4b4.Te6edf3randomTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72const Tff7b72val Te6edf3KEY_ANALYTICS_ALLOWED Tff7b72= Ta5d6ff"Ta5d6ffallowedTa5d6ff"
Tff7b72const Tff7b72val Te6edf3KEY_INSTALL_ID Tff7b72= Ta5d6ff"Ta5d6ffappPrefs_install_idTa5d6ff"

Tff7b72val Te6edf3KEY_ANALYTICS_ALLOWED_PREF Tff7b72= Te6edf3booleanPreferencesKeyTb4b4b4(Te6edf3KEY_ANALYTICS_ALLOWEDTb4b4b4)
Tff7b72val Te6edf3KEY_INSTALL_ID_PREF Tff7b72= Te6edf3stringPreferencesKeyTb4b4b4(Te6edf3KEY_INSTALL_IDTb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.06s